package io.renren.controller;

import io.renren.common.entity.XlsCommodityEntity;
import io.renren.service.XlsCommodityService;
import io.renren.utils.AppResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品控制层
 *
 * @author liuduan
 * @since 1.0.0 2020-04-11
 */
@RestController
@RequestMapping("/api/xlscommodity")
@Api(tags = "商品控制")
public class ApiXlsCommodityController {

    @Autowired
    private XlsCommodityService xlsCommodityService;


    /**
     * 查询商品列表
     * @return
     */
    @RequestMapping("/getCommodityInfo")
    @ApiOperation("商品列表")
    public AppResult getCommodityInfo(){
        return xlsCommodityService.getCommodityInfo();
    }

    /**
     * 根据商品id查询商品详情
     * @param xlsCommodityEntity
     * @return
     */
    @RequestMapping("/getCommodityDeatil")
    @ApiOperation("根据商品Id查询商品详情")
    public AppResult getCommodityDeatil(XlsCommodityEntity xlsCommodityEntity){
        return xlsCommodityService.getCommodityDeatil(xlsCommodityEntity);
    }

}
